<!DOCTYPE html>
<html>
<head>
<title>需求信息页面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript">
        var path = window.document.location.href;
        var pathName = window.document.location.pathname;
        var hostPath = path.substring(0, path.indexOf(pathName));
        var projectName = pathName.substring(0, pathName.substr(1).indexOf("/") + 1);
        document.write('<scr' + 'ipt src="' + projectName + '/js/html/header.js"></scr'+'ipt>');
    </script>
</head>
<body>
	<table id="dg" style="width: auto; height: auto" fitColumns="true">
		<thead>
			<tr>
			<th field="id" data-options="hidden:true">ID</th>
			<th field="requireNo" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">需求编号</th>
			<th field="requireName" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">需求名称</th>
			<th field="requireType" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">需求类型</th>
			<th field="isProject" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">是否项目</th>
			<th field="budget" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">预算金额(万)</th>
			<th field="department" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">需求提出部门</th>
			<th field="subdepart" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">需求提出三级部门</th>
			<th field="pm" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">项目经理</th>
			<th field="pmDepartment" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">项目经理所在部门</th>
			<th field="mainSystem" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">涉及改造的主系统</th>
			<th field="status" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">状态</th>
			<th field="comments" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">审批意见</th>
			<th field="comments" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">当前处理人</th>
			<th field="comments" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">下一个处理人</th>
			<th field="comments" align="right" width="100" 
				data-options="
				sortable:true,
				remoteSort:false
				">上一个处理人</th>
			</tr>
		</thead>
	</table>
	<div id="dg-buttons" style="height: auto">
		<div style="margin-bottom:5px">
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" 	onclick="dlgAdd()">新增</a>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" 	onclick="dlgRemove()">删除</a>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" 	onclick="dlgEdit()">修改</a>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-print',plain:true" 	onclick="dlgExport()">导出</a>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" 	onclick="commit()">提交</a>
		</div>
		<div>
			<span>&nbsp;&nbsp;&nbsp;&nbsp;选择:</span>
			<input type="text" id="searchKey" name="searchKey" class="easyui-combobox" />
			<span>等于:</span>
			<input type="text" id="searchValue" name="searchValue" class="easyui-validatebox" />
			<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" onclick="dgop.find()">查询</a>
		</div>
	</div>
<div id="dlg-buttons">
		<a href="javascript:dlgSave()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
		<a href="javascript:dlgClose()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
	</div>
	<div id="dlg" class="easyui-dialog" closed="true" style="width: 730px; height: 380px; padding: 10px 10px;" buttons="#dlg-buttons">
		<form method="post" id="fm">
			<table cellspacing="8px;">
				<td><input id="id" name="id" style="display: none" ></td>
			<tr>
				<td>需求编号</td>
				<td><input id="requireNo" name="requireNo" class="easyui-validatebox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>需求名称</td>
				<td><input id="requireName" name="requireName" class="easyui-validatebox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>需求类型</td>
				<td><input id="requireType" name="requireType" class="easyui-combobox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>是否项目</td>
				<td><input id="isProject" name="isProject" class="easyui-combobox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>预算金额(万)</td>
				<td><input id="budget" name="budget" class="easyui-validatebox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>需求提出部门</td>
				<td><input id="department" name="department" class="easyui-combobox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>需求提出三级部门</td>
				<td><input id="subdepart" name="subdepart" class="easyui-validatebox" >
				</td>
			</tr>
			<tr>
				<td>项目经理</td>
				<td><input id="pm" name="pm" class="easyui-validatebox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>项目经理所在部门</td>
				<td><input id="pmDepartment" name="pmDepartment" class="easyui-combobox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>涉及改造的主系统</td>
				<td><input id="mainSystem" name="mainSystem" class="easyui-validatebox" 
					>
				</td>
			</tr>
			<tr>
				<td>审批意见</td>
				<td><input id="comments" name="comments" class="easyui-combobox"
					>
				</td>
			</tr>
			<tr>
				<td>当前处理人</td>
				<td><input id="currentHandler" name="currentHandler" class="easyui-validatebox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>下一个处理人</td>
				<td><input id="nextHandler" name="nextHandler" class="easyui-validatebox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
				</td>
			</tr>
			<tr>
				<td>上一个处理人</td>
				<td><input id="lastHandler" name="lastHandler" class="easyui-validatebox" required="true" 
					>&nbsp; 
					<span style="color: red">*</span>
					>
				</td>
			</tr>
			</table>
		</form>
	</div>
	<div id="dlg-Details" class="easyui-window" closed="true" style="width: 730px; height: 280px; padding: 10px 10px;"></div>
	<script>
	var initd = {
			queryDataURL : "/projectinfo/projectInfoQuery.do",
			saveDataURL : "/projectinfo/projectInfoSave.do",
			removeDataURL:"/projectinfo/projectInfoRemove.do",
			commitDataURL:"/projectinfo/projectInfoCommit.do",
			dg : $('#dg'),
			dataDicList:{'ISPROJECT':['isProject'],'REQUIRETYPE':['requireType'],
				'REQUIRESTATUS':['status'],'DEPARTMENT':['department'],
				'PMDEPARTMENT':['pmDepartment'],'COMMENTS':['comments']}
		};
		
		function commit() {
			var selectedRows = $("#dg").datagrid("getSelections");
			if (selectedRows.length != 1) {
				$.messager.alert("系统提示", "请选择一条要编辑的数据！");
				return;
			}
			var row = selectedRows[0];
			alert(row)
			
			$.messager.progress();
			$.ajax({
				type : "POST",
				url : projectName + initd.commitDataURL,
				data: row,
				dataType : "json",
				success : function(data) {
					if (data != null) {
						alert('提交成功');
						$.messager.progress("close");
					}
				}
			});
		}
		
		
	</script>
</body>
</html>
